package xml.model;

/**
 * Enumération des différents types de Coordonnée.
 * @author marya
 */
public enum Type {

    HOME,
    WORK,
    PRIVATE;

    @Override
    public String toString() {
        String result = "";
        switch (this) {
            case HOME:
                result = "Home";
                break;
            case WORK:
                result = "Work";
                break;
            case PRIVATE:
                result = "Private";
                break;
        }
        return result;
    }

    public String toHTML() {
        return "<span class='type'>" + toString() + "</span>";
    }

    public static Type getType(String type) {
        Type result = Type.PRIVATE;
        if (type.equals("Home")) {
            result = Type.HOME;
        } else if (type.equals("Work")) {
            result = Type.WORK;
        } else if (type.equals("Private")) {
            result = Type.PRIVATE;
        }
        return result;
    }
}
